﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TLSharp;

public partial class RemoveRequest : System.Web.UI.Page
{
    public string CookieUserName = "";
    public string CookiePassword = "";
    public string AppGuid = System.Configuration.ConfigurationSettings.AppSettings["AppGuid"];

    protected void Page_Load(object sender, EventArgs e)
    {
       
        CookieUserName = Request.Cookies["TLUsername"] != null ? Request.Cookies["TLUsername"].Value : "";
        CookiePassword = Request.Cookies["TLPassword"] != null ? Request.Cookies["TLPassword"].Value : "";
        int GameRequestID = System.Convert.ToInt32(Request["GameRequestID"]);
        

       
        RemoveRequestResponse  TurnReq = TouchLeagueService.RemoveRequest(CookieUserName, CookiePassword, AppGuid, GameRequestID);
        
        System.Text.StringBuilder ResponseText = new System.Text.StringBuilder();
        if (TurnReq.ResultType == "Success")
        {

            ResponseText.Append("<ul><li>Request Removed.</li><li><a href='default.aspx' target=_self>Back Home</a></li></ul>");
        }
        else
        {
            ResponseText.Append("<ul><li>An error occured.  Maybe this request no longer exists?  Or maybe you don not have rights to remove it?</li><li><a href='default.aspx' target=_self>Back Home</a></li></ul>");
        }

        Response.Write(ResponseText.ToString());
        Response.End();


    }
}
